<template>
  <div class="cu-common-layout">
    <div class="cu-common-layout-center">
      <el-row class="cu-common-search-box" :gutter="16"></el-row>
      <div class="cu-common-layout-main cu-flex-main">
        <div class="cu-common-head">
          <!-- <div>
            <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增定金</el-button>
          </div> -->
          <div class="cu-common-head-right">
            <el-tooltip effect="dark" content="刷新" placement="top">
              <el-link icon="icon-ym icon-ym-Refresh cu-common-head-icon" :underline="false" @click="reset()" />
            </el-tooltip>
            <screenfull isContainer />
          </div>
        </div>
        <custom-table v-loading="listLoading" :data="list">
          <el-table-column prop="brand" label="品牌" align="left" width="80" show-overflow-tooltip>
            <template slot-scope="scope">
              {{ scope.row.brand | dynamicCodeText(brandOptions) }}
            </template>
          </el-table-column>
          <el-table-column prop="customerId" label="客户" align="left" width="100" show-overflow-tooltip />
          <el-table-column prop="manageName" label="收款对接人" align="left" width="80" show-overflow-tooltip></el-table-column>
          <el-table-column prop="primarySchool" label="意向学校" align="left" width="180" show-overflow-tooltip />
          <el-table-column prop="type" label="缴费类型" align="left" width="80">
            <template slot-scope="scope">
              {{ scope.row.type | dynamicText(typeOptions) }}
            </template>
          </el-table-column>
          <el-table-column prop="amount" label="缴费金额" align="left" width="100" show-overflow-tooltip />
          show-overflow-tooltip
          <el-table-column prop="paymentDate" label="缴费日期" header-align="center" align="left" width="120" :formatter="custom.tableDateFormat" />
          <el-table-column prop="finalPaymentDate" label="尾款日期" header-align="center" align="left" width="120" :formatter="custom.tableDateFormat" show-overflow-tooltip />
          <el-table-column prop="remarks" label="备注" align="left" min-width="200" show-overflow-tooltip />
          <el-table-column prop="flowState" label="审核状态" align="center" width="100">
            <template slot-scope="scope">
              <el-tag v-if="scope.row.flowState == 1">等待审核</el-tag>
              <el-tag type="success" v-else-if="scope.row.flowState == 2">审核通过</el-tag>
              <el-tag type="danger" v-else-if="scope.row.flowState == 3">审核驳回</el-tag>
              <el-tag type="danger" v-else-if="scope.row.flowState == 4">流程撤回</el-tag>
              <el-tag type="warning" v-else-if="scope.row.flowState == 5">审核终止</el-tag>
            </template>
          </el-table-column>
          <el-table-column label="操作" fixed="right" width="180" align="center">
            <template slot-scope="scope">
              <el-button type="text" @click="addOrUpdateHandle(scope.row, scope.row.flowState)" :disabled="[1, 2, 5].indexOf(scope.row.flowState) > -1">编辑</el-button>
              <!-- <el-button size="mini" type="text" :disabled="!scope.row.flowState" @click="addOrUpdateHandle(scope.row, scope.row.flowState)">详情</el-button> -->
              <!-- <el-button type="text" @click="handlePrint(scope.row.id, scope.row)" class="cu-table-delBtn" v-if="scope.row.flowState == 2">打印预览</el-button> -->
            </template>
          </el-table-column>
        </custom-table>
        <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" />
        <FormPrint v-if="printFormVisible" ref="PrintForm" @refresh="refresh" />
      </div>
    </div>
    <FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
  </div>
</template>
<script>
export { default } from './index.js'
</script>
